package com.yy.enums;

public enum TaskRange {
    MORNING(0, "上午"),
    AFTERNOON(1, "下午");

    private final int code;
    private final String description;

    TaskRange(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static String getDescriptionByCode(int code) {
        for (TaskRange status : TaskRange.values()) {
            if (status.getCode() == code) {
                return status.getDescription();
            }
        }
        return null; // 或者抛出异常或返回默认值，取决于你的需求
    }
}

